
#ifndef CONF_H
#define CONF_H
#include <arpa/inet.h>
#include "array.h"

#if USE_INI
#include "ini_api.h"
#else
#include "lua_api.h"
#endif

typedef struct {
	struct {
		char *debug;
		char *error;
		char *warn;
		char *access;
		char *conf;
	}log;

	struct {
		int debug_mode; /* 0 */
		int debug_level;   /* 1 */
		int port;
		int worker;
		int maxfds;
		int64_t max_object_size_in_mem;
		int64_t max_size_in_shm;
		int64_t max_size_in_mem;
		int64_t objects;
		struct in_addr bind_addr4;
		int daemon;
	}server;

	struct {
		time_t client_life;
		time_t server_life;
		time_t request;
		time_t reply;
		time_t connect;
	}timeout;
	
	struct {
		array *dir;
	}cache;

}config_t;

extern void conf_reload(void);
extern void conf_default(void);
extern void conf_parse(void);
#endif
